package entity;

import static javax.persistence.GenerationType.IDENTITY;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 * Klasa FootballMatch povezuje entitet FOOTBALLMATCH u bazi podataka i sinhronizuje
 * 
 * @author rigo
 * 
 */
@Entity
@Table(name="FOOTBALLMATCH")
public class FootballMatch implements Serializable {
	private static final long serialVersionUID = -2551164428372068042L;
	@Id
	@GeneratedValue(strategy=IDENTITY) 
	@Column(name="FO_ID", unique=true, nullable=false)
	protected Integer matchId;

	@OneToOne(optional=true)	
	@JoinColumn(name="AP_ID", referencedColumnName="AP_ID", nullable=false)
	protected Appointment appointment;

	@Column(name="FO_NAME", unique=false, nullable=true)
	protected String name;
	
	@ManyToOne	
	@JoinColumn(name="US_ID_MVP", referencedColumnName="US_ID", nullable=true)
	protected User mvp;
	
	@Column(name="FO_GOAL_HOME", unique=false, nullable=true)
	protected Integer goalHome;
	
	@Column(name="FO_GOAL_GUEST", unique=false, nullable=true)
	protected Integer goalGuest;
	
	@Column(name="FO_VOTINGACTIVE", unique=false, nullable=true)
	protected Boolean votingActive;

	public Integer getMatchId() {
		return matchId;
	}

	public void setMatchId(Integer matchId) {
		this.matchId = matchId;
	}

	public Appointment getAppointment() {
		return appointment;
	}

	public String getName() {
		return name;
	}

	public User getMvp() {
		return mvp;
	}

	public Integer getGoalHome() {
		return goalHome;
	}

	public Integer getGoalGuest() {
		return goalGuest;
	}

	public void setAppointment(Appointment appointment) {
		this.appointment = appointment;
	}

	public void setName(String name) {
		this.name = name;
	}

	public void setMvp(User mvp) {
		this.mvp = mvp;
	}

	public void setGoalHome(Integer goalHome) {
		this.goalHome = goalHome;
	}

	public void setGoalGuest(Integer goalGuest) {
		this.goalGuest = goalGuest;
	}

	public Boolean getVotingActive() {
		return votingActive;
	}

	public void setVotingActive(Boolean votingActive) {
		this.votingActive = votingActive;
	}

}
